<?php

/*
 * File name : Download.php
 * Description : Helps in downloding the agency details in a PDF format.
 * Created By : Pratibha Awasthi
 */

include_once "basePage.php";

class DownloadPdf extends basePage{
	
	// Downloads the PDF file from the Server location to the users Download folder
	public function download_pdf(){

		$path = $_SERVER['DOCUMENT_ROOT']."/good-mojo-donation/trunk/src/html2fpdf/"; 
		session_start();
		$filename = $_SESSION['agency_search'].'_Agency_Documents';
		$fullfilename = $filename.'.pdf';
		
		$fullPath = $path.$_GET[$filename];
		
		header('Content-type: application/pdf');
		header('Content-disposition: attachment; filename= '.$fullfilename);
		
		$file_location = $path.$filename.'.pdf';

		readfile($file_location);

    
    
    }
}

$page = new DownloadPdf();
$page->header();
$page->top_menu_donor();
$page->download_pdf();
$page->footer();
?>